num = input("请输入一个5位数")
if num.isdigit():
    num_1 = num[::-1]
    print(num_1)
    if int(num) == num_1:
        print(f"{num}是回文数")
    else:
        print(f"{num}不是回文数")
else:
    print(f"{num}不是纯数字，请重新输入")



story = "Once upon a time, in a land far away, lived a brave knight named Arthur."
num1 = story.split()
print(len(num1))
num2 = story.find("Arthur")
print(f"位置在{num2}")
num3 = story.replace("Arthur", "wwj")
print(num3)
num4 = story.upper()
print(num4)
num5 = story.lower()
print(num5)



students = [["Anna", 90], ["Tom", 78], ["Jerry", 85], ["Lucy", 92]]
students1 = len(students)
print(f"学生总数为{students1}")
l1 = ["Mark", 87]
l2 = ["Eva", 80]
students.append(l1)
students.append(l2)
print(students)
del students[1]
print(students)


books = ["Python Programming", "Data Structures", "Artificial Intelligence", "Web Development"]
print(len(books))
books.append("Machine Learning")
print(books)
delete_book = "Python Programming"
if delete_book in books:
    books.remove(delete_book )
    print(books)
else:
    print(f"{delete_book }不在书籍列表中")

books.sort()
print(f"书籍按字母顺序排序后为{books}")
